//获取应用实例
var app = getApp();
Page({
  data: {
    thumb: '',
    nickname: '',
    location:''
  },
  onLoad() {
    var self = this;
    /**
     * 获取用户信息
     */
    wx.getUserInfo({
      lang: 'zh_CN',
      success: function (res) {
        app.globalData.nickname = res.userInfo.nickName,
        self.setData({
          thumb: res.userInfo.avatarUrl,
          nickname: res.userInfo.nickName,
          location: res.userInfo.country + "-" + res.userInfo.province + "-" + res.userInfo.city
        })
      }
    })
  },
  toAddCategory: function (event) {
    wx.navigateTo({
      url: "../addCategory/addCategory"
    })
  },
  toAddYiJian: function (event) {
    wx.navigateTo({
      url: "../addYiJian/addYiJian"
    })
  },
  toAbout: function (event) {
    wx.navigateTo({
      url: "../about/about"
    })
  },
  tozan:function(event){
    wx.previewImage({
      current: 1, // 当前显示图片的http链接  
      urls: [app.globalData.zanUrl] // 需要预览的图片http链接列表  
    })  
  }
})
  